let express = require('express');
let FriendRequestAction = require('../../action/friendRequestAction');
let router = express.Router();

router.post('/create', function (req, res) {
    req.StatusCode = "WAIT";
    req.body.CreatedAt = new Date();
    FriendRequestAction.create(req.body).then(res.res,res.rej);
});
router.post('/delete', function (req, res) {
    FriendRequestAction.delete(req.body).then(res.res,res.rej);
});
router.post('/list', function (req, res) {
    req.body.options = {limit:99999};
    FriendRequestAction.list(req.body).then(res.res,res.rej);
});
router.post('/accept', function (req, res) {
    FriendRequestAction.accept(req.body).then(res.res,res.rej);
});
router.post('/refresh', function (req, res) {
    FriendRequestAction.refresh(req.body).then(res.res,res.rej);
});

module.exports = router;
